package com.example.ui.contact.test;

import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.json.JSONException;
import org.json.JSONObject;

import com.example.ui.contact.bean.User;
import com.example.ui.contact.chat.L;
import com.example.util.Util;

import android.app.Activity;
import android.content.Context;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;

public class testActivity extends Activity {
	
    private static final Pattern PAT_URL = Pattern.compile("\\:(\\S+?)\\|");
	
	private String phone = "0:15083556227|1:13870645207|2:13657097643|3:15070963860|4:15068861004|" +
			"5:15801817988|6:13576078901|7:15618107373|8:13340082996|9:07933277274|10:4008308300|" +
			"11:13755626512|12:1259315070498123|13:1259307933277111|14:1259313810647799|15:13430844104|" +
			"16:15270820736|17:15970430220|18:15070487367|19:18610798479|20:15970307794|21:15921852143|" +
			"22:13870854223|23:15618241817|24:15000479041|25:18607961761|26:18620237612|27:15263579815|" +
			"28:15692918845|29:13970895886|30:13970947803|31:18616924908|32:13670285601|33:6750|34:1259313697091989|" +
			"35:1259315279361120|36:15279361120|37:15221653166|38:15618107373|39:15170408761|40:15259271277|" +
			"41:13065721747|42:013065721747|43:13858854283|44:13034200539|45:18501655453|46:15870635342|" +
			"47:13870870477|48:15180474312|49:15382752969|50:18507949785|51:13918334405|52:18321861294|" +
			"53:13699551817|54:13545261860|55:13590402667|56:13907914210|57:15170453058|58:15170453058|" +
			"59:13361653948|60:18656600331|61:15180463344|62:13870071442|63:13761709960|64:15870614757|" +
			"65:15179172044|66:15170029616|";
	public void UtilStr(){
		String temp = new String(phone);
        String[] str = temp.split("\\|");
        int str_length = str.length;
			L.Debug("str length", ""+str_length);        
        for(int i=0;i<str_length;i++){
  			L.Debug("str"+"["+i+"]", str[i]);
        	int length = str[i].length();
        	String[] str_L = new String[str_length];
        	String[] str_R = new String[str_length];
        	for(int j=0;j<length;j++){
        		if(str[i].substring(j, j+1).equals(":")){
        			str_L[i] = str[i].substring(0, j).trim();
        			str_R[i] = str[i].substring(j+1,length).trim();
        			L.Debug("str_L"+"["+i+"]", str_L[i]);
        			L.Debug("str_R"+"["+i+"]", str_R[i]);
        		}
        	}
        }
	}
    String strJson = "{\"students\":[{\"name\":\"Jack\",\"age\":12}, {\"name\":\"Vista\",\"age\":23}, " +
    		"{\"name\":\"Kaka\",\"age\":22}, {\"name\":\"Hony\",\"age\":31}]}";
	private String message ="{\"response\":\"friendmsg\",\"friendmsg\":{\"type\":\"1\",\"friend\":{\"id\":\"123\",\"mobile\":\"15221653266\"," +
			                 "\"username\":\"嘻嘻嘻\",\"gender\":\"男\",\"company\":\"肉蒲团的开发骨干\",\"zhiwu\":\"日fe几个fiu给u\"," +
			                 "\"occupation\":\"影视圈\",\"supply\":\"女人\",\"requirement\":\"男人\"," +
			                 "\"headpic1\":\"/upload/headpic/5fde596c-d935-4720-9f93-c3d333143d04.jpg\"," +
			                 "\"token\":\"1111256221913402299\",\"tokenType\":\"1\"}}}";
	private String MeContent = "123";
	private String type = "0";
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		try {
			MeContent = new JSONObject(message).getString("friendmsg");
			L.Debug("REQUEST_MSG_STATE MeContent", MeContent);
			JSONObject json = new JSONObject(MeContent);
			type = json.getString("type");
			L.Debug("REQUEST_MSG_STATE type", type);
		} catch (JSONException e) {
			e.printStackTrace();
			L.Debug("MainActivity REQUEST_MSG_STATE", e.getMessage());
		}

	}


}













